package com.surfilter.modules.user.service;

import java.io.IOException;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.surfilter.modules.user.model.ModuleModel;
import com.surfilter.modules.user.model.RoleModel;
import com.surfilter.modules.user.model.UserModel;

public interface UserMgr {
	/**** 用户信息维护 ****/
	public int addUser(UserModel userModel, List<Integer> roleIds,
			List<Integer> moduleIds, List<Integer> actionIds,
			HttpServletRequest request);

	public void chgUser(UserModel userModel, List<Integer> roleIds,
			List<Integer> moduleIds, List<Integer> actionIds,
			HttpServletRequest request);

	public void delUser(UserModel userModel, HttpServletRequest request);

	public List<UserModel> getUsers(UserModel userModel,
			HttpServletRequest request);

	public int getUsersCount(UserModel userModel);

	public boolean delUsers(List<Integer> userIds,HttpServletRequest request,HttpServletResponse response) throws Exception;

	/**** 用户角色分配 ****/
	public List<RoleModel> getNotUserRoles(Integer userId);

	public List<RoleModel> getUserRoles(Integer userId);

	/**** 用户权限分配 ****/
	public List<ModuleModel> getUserValidModulesAndActionsForAuthTree(
			Integer userId);
	/**
	 * 修改用户密码
	 * @param request
	 * @param response
	 * @throws IOException 
	 */
	public void changeUserPwd(HttpServletRequest request,HttpServletResponse response) throws IOException;
}
